home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / dev / e / eiffel.lha / flc / framework / SORTABLE < prev    next >
Encoding:
Text File  |  1996-01-20  |  918 b   |  33 lines

  1.  
  2. -- This class is very usefull as many objects such as integers and
  3. -- strings are sortable. It will allow to get best benefits from
  4. -- sorted structured such as trees.
  5.  
  6. indexing
  7.  
  8.   names: sorted, sortable, comparable;
  9.   size: unlimited;
  10.   contents: sortable, comparable;
  11.  
  12.   author: "Guichard Damien";
  13.   created: 19,January,1996;
  14.   modified: 19,January,1996
  15.  
  16. deferred class SORTABLE  -- Provide sortable entities.
  17.   inherit COLLECTION
  18.     undefine is_equal  -- Undefine a feature from ANY just for fun and
  19.     end                -- consistency with is_less and is_greater.
  20. feature{ANY}
  21.   is_less (other:like Current):BOOLEAN is
  22.     -- Is 'other' less than current object?
  23.     require  -- other /= Void
  24.     deferred
  25.     end;  -- is_less
  26.   is_greater (other:like Current):BOOLEAN is
  27.     -- Is 'other' greater than current object?
  28.     require  -- other /= Void
  29.     deferred
  30.     end   -- greater
  31. end  -- class 'SORTABLE'
  32.  
  33.